The present invention relates to the definition and association of object properties in a computer system.
In computer systems, associations can be made between objects on the system and one or more xe2x80x9cpropertiesxe2x80x9d. A property encompasses any constraint, definition, operation, or any other definable association that can be made between the object and other entities in the computer system. A xe2x80x9cclassxe2x80x9d or xe2x80x9cobject typexe2x80x9d refers to a definition of a family of objects or system structures. An xe2x80x9cinstancexe2x80x9d is an instantiation of a class or object type definition, and is often created at run-time.
The properties of an instance are normally inherited from the properties defined for its familial class or object type. As an example, consider the database statement below which is in the Oracle8 structured query language (xe2x80x9cSQLxe2x80x9d) syntax (for the Oracle8 database management system available from Oracle Corporation of Redwood Shores, Calif.):
CREATE TABLE stock_xactions
(stock_symbol CHAR(5),
stock_series CHAR(1),
num_shares NUMBER(10),
price NUMBER(5,2),
trade_date DATE)
TABLESPACE ts0
STORAGE (INITIAL 100K NEXT 50K) LOGGING
PARTITION BY RANGE (trade_date) p2 (PARTITION sx1992 VALUES LESS THAN (TO_DATE(xe2x80x9801-JAN-1993xe2x80x99,xe2x80x98DD-MON-YYYYxe2x80x99)),
PARTITION sx1993 VALUES LESS THAN (TO_DATE(xe2x80x9801-JAN-1994xe2x80x99,xe2x80x98DD-MON-YYYYxe2x80x99)) TABLESPACE ts1,
PARTITION sx1994 VALUES LESS THAN (TO_DATE(xe2x80x9801-JAN-1995xe2x80x99,xe2x80x98DD-MON-YYYYxe2x80x99)) TABLESPACE ts2);
This SQL statement creates multiple partitions (i.e., partitions sx1992, sx1993, and sx1994) within a table stock_xactions. Each partition is considered an instance of the class stock_xactions. In this example, partition sx1992 inherits all properties, including the TABLESPACE property, from the definition of the class stock_xactions. Thus, both the class stock_xactions and the instance sx1992 have the TABLESPACE property ts0. It is possible for an instance to override the definition made for its class. For example, partitions sx1993 and sx1994 have been defined to override the TABLESPACE property of its familial class. Specifically, partition sx1993 is defined to have TABLESPACE ts1 and partition sx1994 is defined to have TABLESPACE ts2.
Note that this definition of properties for classes and instances is static. It is often desirable to dynamically add, change, or delete properties of classes, objects, or object types, even for run-time instantiations of these entities. For example, it is often desirable to change either the set of properties, or to change the value of one or more properties, that have been defined for instances on the system, particularly when the new set of properties or new property value is to be dynamically determined at run-time. However, once the above SQL statement has been executed to create the defined partitions, known systems do not have a mechanism to dynamically determine the properties of the respective class or instances. To change any of the properties for the class or instance defined by the above example, known systems would need to drop and recreate the table with new definitions for the respective class and instances.
Therefore, there is a need for a method and mechanism that addresses these and other problems for associating and defining properties in a computer system. There is a need for a method and mechanism that allows properties of a class, object type, object, instance, or other system entities to be dynamically changed.
A method and system for associating properties in a computer system is described. An aspect of the invention relates to a mechanism for dynamically determining the value of a property for an instance or object, which can override the property defined for the class or object type. Another aspect of the invention relates to a mechanism for dynamically changing at run-time the set of properties associated with system structures, such as classes, object types, instances, or objects. Yet another aspect of the invention relates to a mechanism that can associate or disassociate an entire set of properties at the same time, rather than having to separately associate or disassociate each property within a set of properties. A further aspect of the invention relates to a mechanism for allowing particular instances or objects to explicitly not inherit properties of its familial class or object type.
Further details of aspects, objects, and advantages of the invention are described below in the detailed description, drawings, and claims.